import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:get/get.dart';
import 'package:get/get_core/src/get_main.dart';

import '../../base/MyScaffold.dart';
import '../../utils/color/ColorUtils.dart';
import '../../widgets/TextView.dart';
import '../splash/SplashPage.dart';
import 'Verification.dart';

class AccountChangePassword extends StatelessWidget {
  const AccountChangePassword({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    String email = "baixiang787125324@gmail.com";

    TextEditingController phoneContro = TextEditingController();
    FocusNode phoneFocus = FocusNode();
    return MyScaffold(
      bottomline: false,
      body: Container(
        alignment: Alignment.center,
        padding: const EdgeInsets.symmetric(vertical: 24, horizontal: 32),
        child: Column(
          children: [
            TextView(
              "Reset your password",
              alignment: Alignment.centerLeft,
              style: TextStyle(
                  color: rgba(48, 49, 51, 1),
                  fontSize: 24,
                  fontWeight: FontWeight.bold),
            ),
            GestureDetector(
              behavior: HitTestBehavior.opaque,
              onTap: () {
                FocusScope.of(context).requestFocus(phoneFocus);
              },
              child: Container(
                margin: const EdgeInsets.only(top: 24),
                padding: const EdgeInsets.symmetric(horizontal: 12),
                alignment: Alignment.center,
                height: 48,
                decoration: BoxDecoration(
                    border: Border.all(
                      color: rgba(230, 231, 235, 1),
                      width: 1,
                    ),
                    borderRadius: const BorderRadius.all(Radius.circular(10))),
                child: TextField(
                  focusNode: phoneFocus,
                  keyboardType: TextInputType.phone,
                  inputFormatters: [LengthLimitingTextInputFormatter(11)],
                  controller: phoneContro,
                  maxLines: 1,
                  autofocus: false,
                  style: const TextStyle(fontSize: 14),
                  decoration: InputDecoration.collapsed(
                    hintText: 'New password',
                    hintStyle: TextStyle(color: rgba(200, 202, 204, 1)),
                  ),
                  onChanged: (phone) {
                    // chechLoginClick();
                    //
                    // setState(() {});
                  },
                ),
              ),
            ),
            GestureDetector(
              behavior: HitTestBehavior.opaque,
              onTap: () {
                FocusScope.of(context).requestFocus(phoneFocus);
              },
              child: Container(
                margin: const EdgeInsets.only(top: 24),
                padding: const EdgeInsets.symmetric(horizontal: 12),
                alignment: Alignment.center,
                height: 48,
                decoration: BoxDecoration(
                    border: Border.all(
                      color: rgba(230, 231, 235, 1),
                      width: 1,
                    ),
                    borderRadius: const BorderRadius.all(Radius.circular(10))),
                child: TextField(
                  focusNode: phoneFocus,
                  keyboardType: TextInputType.phone,
                  inputFormatters: [LengthLimitingTextInputFormatter(11)],
                  controller: phoneContro,
                  maxLines: 1,
                  autofocus: false,
                  style: const TextStyle(fontSize: 14),
                  decoration: InputDecoration.collapsed(
                    hintText: 'Confirm password aga',
                    hintStyle: TextStyle(color: rgba(200, 202, 204, 1)),
                  ),
                  onChanged: (phone) {
                    // chechLoginClick();
                    //
                    // setState(() {});
                  },
                ),
              ),
            ),
            const SizedBox(
              height: 24,
            ),
            MaterialButton(
              onPressed: () {
                Get.to(const MyHomePage(), arguments: email);
              },
              minWidth: double.infinity,
              color: rgba(255, 78, 77, 1),
              height: 48,
              shape: RoundedRectangleBorder(
                borderRadius: BorderRadius.circular(6),
              ),
              child: const TextView(
                "Submit",
                style: TextStyle(color: Colors.white),
              ),
            )
          ],
        ),
      ),
    );
  }
}
